package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the course database table.
 * 
 */
@Entity
@NamedQuery(name="Course.findAll", query="SELECT c FROM Course c")
public class Course implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="course_id")
	private int courseId;

	@Column(name="course_details")
	private String courseDetails;

	@Column(name="course_hour")
	private int courseHour;

	@Column(name="course_name")
	private String courseName;

	@Column(name="course_type")
	private String courseType;

	@Column(name="course_url")
	private String courseUrl;

	//bi-directional many-to-one association to Activity
	@OneToMany(mappedBy="course")
	private List<Activity> activities;
	
	@OneToMany(mappedBy="course")
	private List<Apply> apply;

	public List<Apply> getApply() {
		return apply;
	}

	public void setApply(List<Apply> apply) {
		this.apply = apply;
	}

	//bi-directional many-to-one association to Ttest
	@ManyToOne
	@JoinColumn(name="ttestid")
	private Ttest ttest;
	
	

	//bi-directional many-to-one association to Record
	@OneToMany(mappedBy="course")
	private List<Record> records;

	//bi-directional many-to-many association to Teacher
	@ManyToMany(mappedBy="courses")
	private List<Teacher> teachers;

	public Course() {
	}

	public int getCourseId() {
		return this.courseId;
	}

	public void setCourseId(int courseId) {
		this.courseId = courseId;
	}

	public String getCourseDetails() {
		return this.courseDetails;
	}

	public void setCourseDetails(String courseDetails) {
		this.courseDetails = courseDetails;
	}

	public int getCourseHour() {
		return this.courseHour;
	}

	public void setCourseHour(int courseHour) {
		this.courseHour = courseHour;
	}

	public String getCourseName() {
		return this.courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getCourseType() {
		return this.courseType;
	}

	public void setCourseType(String courseType) {
		this.courseType = courseType;
	}

	public String getCourseUrl() {
		return this.courseUrl;
	}

	public void setCourseUrl(String courseUrl) {
		this.courseUrl = courseUrl;
	}

	public List<Activity> getActivities() {
		return this.activities;
	}

	public void setActivities(List<Activity> activities) {
		this.activities = activities;
	}

	public Activity addActivity(Activity activity) {
		getActivities().add(activity);
		activity.setCourse(this);

		return activity;
	}

	public Activity removeActivity(Activity activity) {
		getActivities().remove(activity);
		activity.setCourse(null);

		return activity;
	}

	public Ttest getTtest() {
		return this.ttest;
	}

	public void setTtest(Ttest ttest) {
		this.ttest = ttest;
	}

	public List<Record> getRecords() {
		return this.records;
	}

	public void setRecords(List<Record> records) {
		this.records = records;
	}

	public Record addRecord(Record record) {
		getRecords().add(record);
		record.setCourse(this);

		return record;
	}

	public Record removeRecord(Record record) {
		getRecords().remove(record);
		record.setCourse(null);

		return record;
	}

	public List<Teacher> getTeachers() {
		return this.teachers;
	}

	public void setTeachers(List<Teacher> teachers) {
		this.teachers = teachers;
	}

}